24 November, 2025

Event-Driven Architecture in Salesforce: Platform Events & Change Data Capture

by Gorazd Mamurovski

Modern enterprises rely on fast, reliable, and loosely coupled integrations. As Salesforce becomes the digital hub for customer data, it must communicate with multiple systems in real time ERP, marketing platforms, data warehouses, mobile apps, and more.

This is where Event-Driven Architecture (EDA) shines.

In Salesforce, EDA is primarily powered by Platform Events (PE) and Change Data Capture (CDC), two features that allow systems to react to changes as they happen.

What Is Event-Driven Architecture?

Event-driven architecture is an integration model where systems publish events when something happens, and other systems subscribe to those events.

Think of it as Salesforce saying:
“A Lead was created, whoever cares, go act on it.”
Instead of:
“System A, please send this Lead to System B, System C…”
This promotes:
● Loose coupling
● Scalability
● Real-time experiences
● Better system resiliency

Platform Events: Custom Events for Custom Use Cases

Platform Events let you define your own event schema, similar to creating a custom object, but optimized for streaming.

When to Use Platform Events

Use Platform Events when you need to publish business events like:
● “Order Submitted”
● “Payment Processed”
● “Inventory Updated”

How Platform Events Work

1. Define the event (fields, permissions, retention).
2. Publish the event using Apex, Flow, API, or external systems.
3.Subscribe using:
4.Apex triggers
5.Flow subscribers
6.External systems via CometD or Pub/Sub API

Key Benefits

● High-volume event delivery
● Transactional publishing from Apex
● Durable replay using replay IDs
● Support for fan-out (one event, many subscribers)

Change Data Capture: Automatic Events for Object Changes

Salesforce Change Data Capture (CDC) emits events automatically based on CRUD changes to standard or custom objects.
You subscribe to events such as:
● AccountChangeEvent
● OpportunityChangeEvent
● CustomObject__ChangeEvent
No need to build custom triggers or processes, Salesforce handles it for you.

When to Use CDC

Use CDC when you need to sync record changes to:
● Data warehouses (Snowflake, BigQuery, Redshift)
● External databases
● ERP systems
● Custom apps
● Integration layers (Mulesoft, Kafka, Azure Service Bus)

Key Benefits

● Automatic publishing
● Field-level granularity
● All CRUD events supported (Create, Update, Delete, Undelete)
● Receive only changed fields (efficiency!)
● High-throughput streaming

How EDA Fits Into Salesforce Architecture

Modern Salesforce implementations often blend both PE and CDC to create a reactive system architecture. A typical example:
1. Order is created in Salesforce → CDC sends OrderChangeEvent to ERP
2. ERP processes order and publishes “Order Fulfilled” → Salesforce Platform Event triggers updates
3. Marketing Cloud listens to fulfillment events → Sends confirmation email

This approach creates:
● Real-time customer visibility
● Fewer point-to-point integrations
● Greater enterprise flexibility

Security & Governance Considerations

● Permissions: Publishers/subscribers require proper access to event channels
● Replay IDs: Consumers must manage offsets for resiliency
● Volume limits: Understand event limits for your Salesforce edition
● Transactional boundaries: PE can be published after commit via System.enqueueJob()
● Error handling: External subscribers must handle retries gracefully

Conclusion

Salesforce’s event-driven architecture capabilities, Platform Events and Change Data Capture, give organizations the tools to build real-time, scalable integrations and workflows.

Whether your use case involves syncing data to downstream systems or triggering sophisticated cross-cloud workflows, adopting EDA in Salesforce leads to cleaner architecture, lower coupling, and future-ready enterprise design.

Share: